package 笔试.顺丰笔试.统计字符串次数;

import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String[] strings = sc.nextLine().trim().split(" ");
        int cnt = 0;
        for (int i = 0; i < strings.length; i++)
        {
            if (strings[i].toLowerCase().indexOf("apple") != -1)
                cnt++;
        }
        System.out.println(cnt);
    }
}
